export HASTHI_HOME=`pwd`
cd $HASTHI_HOME

HOST_COUNT="10"
MNG_COUNT="20"
RESOURCE_COUNT="40000"
FAIL_RATES="0.7 0.9"

for FAIL_RATE in ${FAIL_RATES}; do
#        md=`echo $p|cut -f1 -d','`
#        RESOURCE_COUNT=`echo $p|cut -f2 -d','`

	$HASTHI_HOME/bootstrap.sh reset
	sleep 1s
		
	export LOG_DIR=/u/hperera/logs/hasthi_${RESOURCE_COUNT}X${MNG_COUNT}_`date +%m_%d_%H_%M`
	echo $LOG_DIR
	mkdir $LOG_DIR
	cmd1="srun -N 1 ./testMngeNode.sh $HASTHI_HOME/hasthi.properties $HASTHI_HOME $LOG_DIR"
	cmd2="srun -N $HOST_COUNT ./simMng.sh $(($MNG_COUNT/$HOST_COUNT)) $(($RESOURCE_COUNT/$MNG_COUNT)) $FAIL_RATE"
	echo $cmd1 $cmd2
	$cmd1 &
	sleep 40s
	$cmd2
	#Following wait for all child processes to complete 
	wait
	mv hasthi*.log $LOG_DIR
	echo "${RESOURCE_COUNT}X${MNG_COUNT} Done"
done 
